import request from '@/utils/request'

// 查询商户信息列表
export function listMerchant(query) {
  return request({
    url: '/business/admin/merchant/list',
    method: 'get',
    params: query
  })
}

// 查询商户信息详细
export function getMerchant(id) {
  return request({
    url: '/business/admin/merchant/' + id,
    method: 'get'
  })
}

// 新增商户信息
export function addMerchant(data) {
  return request({
    url: '/business/admin/merchant',
    method: 'post',
    data: data
  })
}

// 修改商户信息
export function updateMerchant(data) {
  return request({
    url: '/business/admin/merchant',
    method: 'put',
    data: data
  })
}

// 删除商户信息
export function delMerchant(id) {
  return request({
    url: '/business/admin/merchant/' + id,
    method: 'delete'
  })
}

// 操作店铺信息
export function operate(query) {
  return request({
    url: '/business/admin/merchant/operate',
    method: 'post',
    params: query
  })
}


// 查询商户的信用额度记录列表
export function listMerchantCreditLimit(query) {
  return request({
    url: '/business/admin/merchantCreditLimit/myList',
    method: 'get',
    params: query
  })
}

// 查询商户的信用额度记录列表
export function listMerchantBalance(query) {
  return request({
    url: '/business/admin/merchantBalance/myList',
    method: 'get',
    params: query
  })
}

export function listMerchantLevelInfo() {
  return request({
    url: '/business/admin/merchantLevel/allList',
    method: 'get'
  })
}


// 新增余额记录
export function submitBalanceAmount(query) {
  return request({
    url: '/business/admin/merchant/submitBalanceAmount',
    method: 'post',
    params: query
  })
}
// 新增额度记录
export function submitCreditLimitAmount(query) {
  return request({
    url: '/business/admin/merchant/submitCreditLimitAmount',
    method: 'post',
    params: query
  })
}

export function allListMerchantInfo() {
  return request({
    url: '/business/admin/merchant/allList',
    method: 'get'
  })
}
